from django.urls import converters


class UsernameConverter:
    """
    用户名转换器
    """
    regex = '[a-zA-Z0-9_-]{5,20}'

    def to_python(self, value):
        return value


class MobileConverter:
    """
    用户名转换器
    """
    regex = '1[3-57-9]\d{9}'

    def to_python(self, value):
        return value